package com.example.jqying.androiddemo.vistorPattern.data;

import com.example.jqying.androiddemo.vistorPattern.vistorInterface.IAccountBookView;
import com.example.jqying.androiddemo.vistorPattern.vistorInterface.IBill;

import java.util.ArrayList;

/**
 * Created by apple on 2018/7/3.
 */

public class AccountBook {
    private ArrayList<IBill> listBill = new ArrayList<IBill>();

    public void add(IBill bill){
        listBill.add(bill);
    }

    public void show(IAccountBookView viewer){
        for(IBill bill : listBill){
            bill.accept(viewer);
        }
    }
}
